﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Security.Principal;
using System.Text;

namespace WooCoo
{
    /// <summary>
    /// 定义程序上下文信息管理的类型接口
    /// </summary>
    public interface IContextManager
    {
        /// <summary>
        /// 该管理器是否可用
        /// </summary>
        bool IsValid { get; }
        /// <summary>
        /// 取得用户.
        /// </summary>
        IPrincipal GetUser();
        /// <summary>
        /// 设置用户
        /// </summary>
        /// <param name="principal">Principal对象.</param>
        void SetUser(IPrincipal principal);
        /// <summary>
        /// 获取本地上下文对象.
        /// </summary>
        HybridDictionary GetLocalContext();
        /// <summary>
        /// 设置本地上下文对象
        /// </summary>
        /// <param name="localContext">本地上下文.</param>
        void SetLocalContext(HybridDictionary localContext);
        /// <summary>
        /// 获取客户端上下文.
        /// </summary>
        HybridDictionary GetClientContext();
        /// <summary>
        /// 设置客户端上下文.
        /// </summary>
        /// <param name="clientContext">Client context.</param>
        void SetClientContext(HybridDictionary clientContext);
        /// <summary>
        /// 取得全局上下文.
        /// </summary>
        HybridDictionary GetGlobalContext();
        /// <summary>
        /// 设置全局上下文.
        /// </summary>
        /// <param name="globalContext">Global context.</param>
        void SetGlobalContext(HybridDictionary globalContext);
    }
}
